]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st-shadow: Ceil size before comparing with texture
authorJonas Ådahl <jadahl@gmail.com>
Thu, 26 Oct 2017 09:15:46 +0000 (11:15 +0200)
committerJonas Ådahl <jadahl@gmail.com>
Fri, 1 Mar 2019 17:12:52 +0000 (17:12 +0000)
A fractional resource scale would mean we never use the fast path for
creating the shadow, because we'd cast the int to a float before
comparing, which would never match.

Instead compare the expected texture size with the source texture, to
actually potentially trigger the fast path.

https://bugzilla.gnome.org/show_bug.cgi?id=765011

src/st/st-private.c

index c9bcf4c3af5d4dc1303a0e4f12a88119a77ebe0d..688b17b785151af9a2c0c2387628cdc1c8386d14 100644 (file)
@@ -444,8 +444,8 @@ _st_create_shadow_pipeline_from_actor (StShadow     *shadow_spec,
   if (!clutter_actor_get_resource_scale (actor, &resource_scale))
     return NULL;
 
-  width *= resource_scale;
-  height *= resource_scale;
+  width = ceilf (width * resource_scale);
+  height = ceilf (height * resource_scale);
 
   image = clutter_actor_get_content (actor);
   if (image && CLUTTER_IS_IMAGE (image))